<?php
//****************************************************************
//Author: Alex Zdvorak
//Date: 12/6/2009
//contact: zdvor001@csusm.edu
//
// Purpose: The purpose of editemployee.php is to change the
//			attributes of a specified employee. This page 
//			cannot be accessed unless you are a manager.
//
// Expected: This page recieves the post variable 'empID' to
//			determine what employee to edit.
//
// Output: This page goes to editemployee_results.php for 
//			confirmation or error output.
//****************************************************************
session_start();
require_once 'php_includes.php';

//Make sure logged in
checkLogin();

if(!$_POST['empID'])
{
	echo "Did not receive expected POST value.\n";
	
}else{
	$empID = $_POST['empID'];
}

//make sure it is a manager logged on
checkManager();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  
  <head>
    <title>Payroll and Timesheet Management Website</title>
    <link rel="stylesheet" type="text/css" href="styles.css"/>
  </head>
  <body>
  
		<?php
		echo "Edit employee (" . $empID . ")'s Information <br/>";
		?>
		
		<form action="editemployee_results.php" method="post">
		<p>
		<select name="editType" id="type">
			<option value="EmployeeFName">Employee's First Name</option>
			<option value="EmployeeLName">Employee's Last Name</option>
			<option value="EmployeeTitle">Employee's Title</option>
			<option value="EmployeePortrait">Employee's Portrait URL</option>
			<option value="EmployeeSpecialty">Employee's Specialty</option>
			<option value="EmployeeDepart">Employee's Department</option>
			<option value="EmployeeTeam">Employee's Team</option>
			<option value="EmployeeContact">Employee's Contact Information</option>
			<option value="EmployeeExtension">Employee's Extension</option>
			<option value="EmployeeLoc">Employee's Location</option>
			<!--<option value="ManagerID">Employee's Manager ID</option>-->
		
		</select>
		<br />
		New value: <input type="text" name= "newValue" id="newvalue"/><br/>
		<?php
			echo "<input type=\"hidden\" name=\"empID\"value=\"" . $empID . "\" />";
		?>
		<input type="button" value="Cancel" onclick="javascript:window.close();"/>
		<input type="submit" value="Change" />
		</p>
		</form>

  </body>
</html>